import request from "../index";

export default class MenuRequest {
  // 获取菜单信息
  public static getMenu(params) {
    return request({
      url: "/menu",
      params,
      method: "get",
    });
  }

  // 创建菜单
  public static addMenu(data) {
    return request({
      url: "/menu",
      data,
      method: "post",
    });
  }

  // 修改菜单信息
  public static editMenu(data) {
    return request({
      url: "/menu",
      data,
      method: "put",
    });
  }

  // 删除菜单
  public static deleteMenu(params) {
    return request({
      url: "/menu",
      params,
      method: "delete",
    });
  }
  // 获取菜单列表
  public static getMenuList(params) {
    return request({
      url: "/menu/list",
      params,
      method: "get",
    });
  }
  // 获取全部菜单
  public static getAllMenu(params) {
    return request({
      url: "/menu/all",
      params,
      method: "get",
    });
  }
}
